<template>
  <div class="container">
    <div class="app-container">
      <el-row style=" padding: 20px;" width="100%">
        <el-row style="border-bottom: 1px solid #ccc; display: flex;" width="100%">
          <span style="margin-top: 20px;margin-left: 20px">企业名称:</span>
          <el-input placeholder="请输入企业名称" style="margin-top: 15px;margin-bottom: 10px; margin-left: 10px; width: 200px;" size="mini" />
          <div size="mini">
            <span class="demonstration" style="margin-left: 20px;">缴费时间</span>
            <el-date-picker
              v-model="value2"
              style="margin-top: 15px;margin-bottom: 10px; margin-left: 10px; width: 200px;"
              size="mini"
              type="datetimerange"
              :picker-options="pickerOptions"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            />
          </div>
          <el-button type="primary" size="mini" style=" margin-top: 15px; margin-left: 20px; margin-bottom: 20px; width: 65px; border-radius: 10px  ;">查询</el-button>
        </el-row>
      </el-row>
      <el-row style="margin-top: 10px;" type="flex">
        <el-button type="primary" size="mini" style="border-radius: 5px;margin-left: 20px; margin-bottom: 20px;" @click="addBuilding">添加账单</el-button>
      </el-row>
      <template>
        <el-table :data="list">
          <el-table-column label="序号" type="index" />
          <el-table-column label="账单编号" prop="billNumber" />
          <el-table-column label="企业名称" prop="enterpriseName" />
          <el-table-column label="租赁楼宇" prop="buildingName" />
          <el-table-column label="物业费(元/m²)" prop="propertyFeePrice" />
          <el-table-column label="账单金额(元)" prop="paymentAmount" />
          <el-table-column label="缴费时间" prop="endTime" />
          <el-table-column label="操作">
            <template>
              <el-button type="text" size="mini">查看</el-button>
              <el-button type="text" size="mini">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <el-row type="flex" justify="end">
        <el-pagination
          layout="prev, pager, next , jumper , total"
          :total="add.total"
          :page-size="add.pageSize"
          :current-page="add.page"
          @current-change="changePage"
        />
      </el-row>
    </div>
  </div>
</template>
<script>
import { getpermissionAPI } from '@/api/permission'

export default {
  name: 'Attendance',
  data() {
    return {
      list: [],
      add: {
        total: 0,
        name: '',
        pageSize: 10,
        page: 1
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      const { rows, total } = await getpermissionAPI(this.add)
      this.list = rows
      this.add.total = total
    },
    changePage(newpage) {
      this.add.page = newpage
      this.getList()
    },
    editRole(id) {
      this.currentNodeId = id
    }
  }
}
</script>
